package com.learn.security.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.regex.Pattern;

/**
 * @author PC
 * Security配置属性
 */
@Data
@Configuration
@ConfigurationProperties("cus.security")
public class SecurityConfigProperties {

    /**
     * 角色前缀
     */
    private String rolePrefix = "ROLE_";

    /**
     * 加密算法的正则，默认是BCryptPasswordEncoder
     */
    private Pattern encryptPattern = Pattern.compile("\\A\\$2([ayb])?\\$(\\d\\d)\\$[./0-9A-Za-z]{53}");

    /**
     * 最大登陆数
     */
    private Integer maximumSessions = 1;
}
